package com.quartz.quartz.jobs;

import com.quartz.entity.Account;
import com.quartz.quartz.JobBase;
import com.quartz.service.AccountService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.UUID;

/**
 * Created with IntelliJ IDEA.
 * User: lixiao
 * Created Date: 2020/8/6 14:07
 */
public class JobInsertAccount extends JobBase {

    @Autowired
    AccountService accountService;

    @Override
    public void execute(JobExecutionContext var1) throws JobExecutionException {
        Account account=new Account();
        account.setId(UUID.randomUUID().toString());
        account.setMoney(1);
        account.setName("nihao");
        accountService.addAccount(account);
    }
}